<div style="padding: 15px" xmlns:th="http://www.thymeleaf.org">
    <form id="form">
        <div class="form-group">
            <label>用户账号</label>
            <input type="text" class="form-control" placeholder="请输入" name="loginName" id="currentLoginName" th:value="${loginUser.loginName}">
        </div>
        <div class="form-group">
            <label>用户姓名</label>
            <input type="text" class="form-control" placeholder="请输入" name="name" id="currentName" th:value="${loginUser.name}">
        </div>
        <div class="form-group">
            <label>用户性别</label>
            <select class="form-control" name="gender" id="gender">
                <option value="A" th:selected="${loginUser.gender}=='A'">外星人</option>
                <option value="B" th:selected="${loginUser.gender}=='B'">男</option>
                <option value="C" th:selected="${loginUser.gender}=='C'">女</option>
            </select>
        </div>
        <div class="form-group">
            <label>用户类型</label>
            <select class="form-control" name="type" id="type">
                <option value="B" th:selected="${loginUser.type}=='B'">普通用户</option>
                <option value="A" th:selected="${loginUser.type}=='A'">管理员</option>
            </select>
        </div>
        <button type="button" class="btn btn-primary" id="submitBtn">提交</button>
    </form>
</div>
<script>
    $("#submitBtn").click(function () {
        debugger
        var loginName = $("#currentLoginName").val();
        if (loginName === '') {
            msgAlert("请输入用户账号");
            return;
        }
        var name = $("#currentName").val();
        if (name === '') {
            msgAlert("请输入用户姓名");
            return;
        }
        ajaxJson("/user/ajax/update/info", $("#form").serialize(), function (res) {
            msgAlert(res.message);
        })
    })
</script>